/*
 * Copyright @ 苏州瑞云信息技术有限公司 All rights reserved.
 */
package work.exception;

/**
 * @author Sakura Shen
 * @description 测试异常
 * @date 2021/7/6
 */
public class TestException {

    public static String test() throws Exception  {
        throw new Exception("AAA");
//        return "AAA";
    }

    public static void main(String[] args) {
        String aaa = "";
//        System.out.println(aaa.charAt(7));
//        test();

//        throw new Exception("BBB");

//        try {
//
//            System.out.println(aaa.charAt(7));
//        } catch (Exception ignored) {
//            System.out.println(ignored.getMessage());
//
//        }
//        System.out.println(aaa.charAt(7));

        try {
            throw new Exception("自抛自处理");
        } catch(Exception ignored) {
            System.out.println(ignored.getMessage());
        }


    }
}
